package com.city.service.city.impl;

import com.city.domain.city.CityVillage;
import com.city.repository.city.CityVillageRepository;
import com.city.service.city.CityVillageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @deprecation: 村基本信息表
 * @dmail: 398521613@qq.com
 * @author: L-H
 * @date: 2018-07-18 13:14
 */
@Service
public class CityVillageServiceImpl implements CityVillageService {
    @Autowired
    private CityVillageRepository villageRepository;

    @Override
    public List<CityVillage> findName(Integer code) {
        return villageRepository.findAllByTownId(code);
    }


    @Override
    public List<CityVillage> findAll() {
        return villageRepository.findAll();
    }

    /**
     * @Author: 李顺时
     * @Description: 根据镇乡Id信息获取获取乡镇名称
     * @param id 村的id
     * @Date: 16:55 2018/8/12
     */
    @Override
    public String findVillageNameById(Integer id) {
        return villageRepository.findVillageNameById(id);
    }
}
